home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Scene Storm
/
Scene Storm - Volume 1.iso
/
coding
/
asm
/
demos
/
exsyslib
/
include
/
hardware
/
exsys_takeover.s
< prev
Wrap
Text File
|
1980-01-03
|
1KB
|
39 lines
*****************************************************************************
* 'exsys.library' Startup Interface glue routines..
* ---------------------------------------------------------------------------
* This code opens the 'exsys.library' and executes your demo/game code.
* After your demo game has finished it automatically closes itself and returns
* to the OS...
*
* The below defined structure is returned by in a4 at the label '_main' and
* you may read the values from this for your own use. See examples where
* for instance the '_OSVBR' (OS vectorbase register) is used, etc.
******************************************************************************
rsreset
_ID: rs.l 1 ;id of structure..
_OSDmacon rs.w 1 ;dmacon
_OSIntreq rs.w 1 ;intreq
_OSIntena rs.w 1 ;intena
_OSAdkcon rs.w 1 ;adkcon
_OSVBR: rs.l 1 ;vector base (VBR)
_OSCopper1: rs.l 1 ;wb copperlist 1
_OSCopper2: rs.l 1 ;wb copperlist 2
_OSOldview: rs.l 1 ;os oldview
_GfxBase rs.l 1 ;graphics base
_OSVecs: rs.l 62 ;copy of vectorbase
rsreset
ProgStart: move.l 4.w,a6
lea exsysname(pc),a1
jsr -408(a6) ; open exsys.library...
tst.l d0 ; did it open?
beq.s open_error
move.l d0,a6
lea _main(pc),a0
jmp -30(a6) ; Shutdown OS & call our code
open_error: moveq #-1,d0 ; cannot open library...
rts
exsysname: dc.b 'exsys.library',0 ; name of our library..
even
_main: